package com.example.controller;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import com.example.entity.Perminssion;
import com.example.entity.Role;
import com.example.entity.User;
import com.example.service.PerminssionService;
import com.example.service.RoleService;
import com.example.service.UserService;

@RestController
//@RequestMapping(value = "/test"/*, method=RequestMethod.POST*/)
public class TestController {
	
	@Autowired
	private UserService userSI;
	@Autowired
	private RoleService roleSI;
	@Autowired
	private PerminssionService perminssionSI;
	
	@RequestMapping("/user")
	public List<User> user(){
		return userSI.list();//JSON.toJSONString(json);
	}
	
	@RequestMapping("/user/ad")
	public String usera(){
		return "Usera Manage";//JSON.toJSONString(json);
	}
	
	@RequestMapping("/role")
	public List<Role> role(){
		return roleSI.list();//JSON.toJSONString(json);
	}
	
	@RequestMapping("/perminssion")
	public List<Perminssion> perminssion(){
		return perminssionSI.list();//JSON.toJSONString(json);
	}
}
